;
var account_index_ops={
    init:function(){
        account_index_ops.eventBind();
    },
    eventBind:function(){

        var that= this;
        $(".search").click(function(){
            // var form=$(".wrap_search");
            // form.action="index.php?r=web/account/index";
            // form.submit();
            $(".wrap_search").submit();
        });

        $(".remove").click(function(){
            if(!confirm("您确定删除该用户吗？")){
                return ;
            }
           that.ops("remove",$(this).attr("data"))
        });

        $(".recover").click(function(){
            if(!confirm("您确定恢复该用户吗？")){
                return;
            }
            that.ops("recover",$(this).attr("data"))
        });
    },
    ops:function(act,uid){
        $.ajax({
            url:common_ops.buildWebUrl("/account/ops"),
            type:"POST",
            data:{
                act:act,
                uid:uid
            },
            dataType:'json',
            success:function(res){
                common_ops.alert(res.msg);
                if(res.code==200){
                    window.location.href=window.location.href;
                }
            }
        });
    }
};

$(document).ready(function(){
    account_index_ops.init();
});